.class Lcom/instagram/android/d/j/q;
.super Lcom/instagram/android/d/c/a;
.source "StreamingApiRequestLoaderCallbacks.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/instagram/android/d/c/a",
        "<",
        "Lcom/instagram/android/d/j/j",
        "<TT;>;>;"
    }
.end annotation


# instance fields
.field final synthetic n:Lcom/instagram/android/d/j/p;


# direct methods
.method constructor <init>(Lcom/instagram/android/d/j/p;Landroid/content/Context;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 49
    iput-object p1, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-direct {p0, p2}, Lcom/instagram/android/d/c/a;-><init>(Landroid/content/Context;)V

    return-void
.end method


# virtual methods
.method public a(Lcom/instagram/android/d/j/j;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lcom/instagram/android/d/j/j",
            "<TT;>;)V"
        }
    .end annotation

    .prologue
    .line 156
    invoke-super {p0, p1}, Lcom/instagram/android/d/c/a;->b(Ljava/lang/Object;)V

    .line 157
    return-void
.end method

.method public synthetic b(Ljava/lang/Object;)V
    .locals 0
    .parameter

    .prologue
    .line 49
    check-cast p1, Lcom/instagram/android/d/j/j;

    invoke-virtual {p0, p1}, Lcom/instagram/android/d/j/q;->a(Lcom/instagram/android/d/j/j;)V

    return-void
.end method

.method public synthetic d()Ljava/lang/Object;
    .locals 1

    .prologue
    .line 49
    invoke-virtual {p0}, Lcom/instagram/android/d/j/q;->v()Lcom/instagram/android/d/j/r;

    move-result-object v0

    return-object v0
.end method

.method protected l()V
    .locals 0

    .prologue
    .line 151
    invoke-super {p0}, Lcom/instagram/android/d/c/a;->l()V

    .line 152
    return-void
.end method

.method public v()Lcom/instagram/android/d/j/r;
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Lcom/instagram/android/d/j/r",
            "<TT;>;"
        }
    .end annotation

    .prologue
    .line 52
    invoke-static {}, Lcom/instagram/android/d/d/a;->a()V

    .line 54
    new-instance v0, Lcom/instagram/android/d/j/r;

    iget-object v1, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    iget-object v1, v1, Lcom/instagram/android/d/j/p;->a:Landroid/content/Context;

    invoke-direct {v0, v1}, Lcom/instagram/android/d/j/r;-><init>(Landroid/content/Context;)V

    .line 58
    :try_start_0
    iget-object v1, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v1}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v1

    invoke-virtual {v1}, Lcom/instagram/android/d/j/g;->q()V
    :try_end_0
    .catch Lcom/instagram/android/d/j/e; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2

    .line 63
    :goto_0
    :try_start_1
    invoke-static {}, Lcom/instagram/android/d/a/a;->a()Lcom/instagram/android/d/a/a;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2

    move-result-object v2

    .line 65
    const/4 v1, 0x0

    .line 68
    :try_start_2
    iget-object v3, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v3}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v3

    invoke-virtual {v3}, Lcom/instagram/android/d/j/g;->m()Lch/boye/httpclientandroidlib/client/methods/HttpUriRequest;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/instagram/android/d/a/a;->a(Lch/boye/httpclientandroidlib/client/methods/HttpUriRequest;)Lch/boye/httpclientandroidlib/HttpResponse;

    move-result-object v1

    .line 69
    invoke-interface {v1}, Lch/boye/httpclientandroidlib/HttpResponse;->getEntity()Lch/boye/httpclientandroidlib/HttpEntity;

    move-result-object v2

    .line 71
    iget-object v3, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v3}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v3

    invoke-virtual {v3, v1}, Lcom/instagram/android/d/j/g;->a(Lch/boye/httpclientandroidlib/HttpResponse;)V

    .line 74
    new-instance v4, Lcom/fasterxml/jackson/a/e;

    invoke-direct {v4}, Lcom/fasterxml/jackson/a/e;-><init>()V

    .line 75
    invoke-interface {v2}, Lch/boye/httpclientandroidlib/HttpEntity;->getContent()Ljava/io/InputStream;

    move-result-object v3

    .line 76
    iget-object v2, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v2}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v2

    invoke-virtual {v2}, Lcom/instagram/android/d/j/g;->r()Ljava/io/File;

    move-result-object v2

    if-eqz v2, :cond_b

    .line 77
    new-instance v2, Lcom/instagram/android/d/j/n;

    iget-object v5, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v5}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v5

    invoke-virtual {v5}, Lcom/instagram/android/d/j/g;->r()Ljava/io/File;

    move-result-object v5

    invoke-direct {v2, v3, v5}, Lcom/instagram/android/d/j/n;-><init>(Ljava/io/InputStream;Ljava/io/File;)V

    .line 80
    :goto_1
    invoke-virtual {v4, v2}, Lcom/fasterxml/jackson/a/e;->createParser(Ljava/io/InputStream;)Lcom/fasterxml/jackson/a/l;

    move-result-object v3

    .line 82
    :cond_0
    :goto_2
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->nextToken()Lcom/fasterxml/jackson/a/r;

    move-result-object v4

    sget-object v5, Lcom/fasterxml/jackson/a/r;->c:Lcom/fasterxml/jackson/a/r;

    if-eq v4, v5, :cond_9

    .line 83
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->getCurrentName()Ljava/lang/String;

    move-result-object v4

    .line 84
    const-string v5, "status"

    invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 85
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->nextToken()Lcom/fasterxml/jackson/a/r;

    .line 86
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->getText()Ljava/lang/String;

    move-result-object v4

    .line 87
    invoke-virtual {v0, v4}, Lcom/instagram/android/d/j/r;->e(Ljava/lang/String;)V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_2

    .line 121
    :catch_0
    move-exception v0

    .line 122
    :try_start_3
    const-string v2, "StreamingApiRequestLoaderCallbacks"

    const-string v3, "Caught exception performing/parsing streaming request"

    invoke-static {v2, v3, v0}, Lcom/facebook/e/a/a;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 123
    iget-object v0, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    iget-object v0, v0, Lcom/instagram/android/d/j/p;->a:Landroid/content/Context;

    sget v2, Lcom/facebook/ba;->network_error:I

    invoke-virtual {v0, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/instagram/android/d/j/r;->d(Ljava/lang/String;)Lcom/instagram/android/d/j/r;

    move-result-object v0

    .line 127
    :goto_3
    if-eqz v0, :cond_2

    .line 128
    if-eqz v1, :cond_1

    .line 129
    invoke-interface {v1}, Lch/boye/httpclientandroidlib/HttpResponse;->getStatusLine()Lch/boye/httpclientandroidlib/StatusLine;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/instagram/android/d/j/r;->a(Lch/boye/httpclientandroidlib/StatusLine;)V

    .line 132
    :cond_1
    invoke-virtual {v0}, Lcom/instagram/android/d/j/r;->g()Z

    move-result v1

    if-eqz v1, :cond_a

    invoke-virtual {v0}, Lcom/instagram/android/d/j/r;->i()Ljava/lang/String;

    move-result-object v1

    if-nez v1, :cond_a

    .line 133
    iget-object v1, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-virtual {v1, v0}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/r;)V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_2

    .line 145
    :cond_2
    :goto_4
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/instagram/android/d/j/r;->a(Z)V

    .line 146
    return-object v0

    .line 59
    :catch_1
    move-exception v1

    .line 60
    :try_start_4
    iget-object v1, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    iget-object v1, v1, Lcom/instagram/android/d/j/p;->a:Landroid/content/Context;

    sget v2, Lcom/facebook/ba;->unknown_error_occured:I

    invoke-virtual {v1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/instagram/android/d/j/r;->d(Ljava/lang/String;)Lcom/instagram/android/d/j/r;
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_2

    goto/16 :goto_0

    .line 138
    :catch_2
    move-exception v0

    .line 140
    const-string v1, "StreamingApiRequestLoaderCallbacks"

    const-string v2, "Caught unhandled exception in streaming request"

    invoke-static {v1, v2, v0}, Lcom/facebook/e/a/a;->d(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 141
    const-string v0, "StreamingApiRequestLoaderCallbacks"

    const-string v1, "Unexpected networking exception"

    invoke-static {v0, v1}, Lcom/instagram/g/c;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 142
    iget-object v0, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    iget-object v0, v0, Lcom/instagram/android/d/j/p;->a:Landroid/content/Context;

    sget v1, Lcom/facebook/ba;->error:I

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/instagram/android/d/j/r;->d(Ljava/lang/String;)Lcom/instagram/android/d/j/r;

    move-result-object v0

    goto :goto_4

    .line 88
    :cond_3
    :try_start_5
    const-string v5, "message"

    invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_4

    .line 89
    iget-object v4, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v4, v3}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;Lcom/fasterxml/jackson/a/l;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v0, v4}, Lcom/instagram/android/d/j/r;->a(Ljava/lang/String;)V

    goto/16 :goto_2

    .line 90
    :cond_4
    const-string v5, "_messages"

    invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_5

    .line 91
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->nextToken()Lcom/fasterxml/jackson/a/r;

    .line 92
    iget-object v4, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v4, v3}, Lcom/instagram/android/d/j/p;->b(Lcom/instagram/android/d/j/p;Lcom/fasterxml/jackson/a/l;)Ljava/util/Collection;

    move-result-object v4

    invoke-virtual {v0, v4}, Lcom/instagram/android/d/j/r;->a(Ljava/util/Collection;)V

    goto/16 :goto_2

    .line 93
    :cond_5
    const-string v5, "checkpoint_url"

    invoke-virtual {v5, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_6

    .line 94
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->nextToken()Lcom/fasterxml/jackson/a/r;

    .line 95
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->getText()Ljava/lang/String;

    move-result-object v4

    .line 96
    invoke-virtual {v0, v4}, Lcom/instagram/android/d/j/r;->f(Ljava/lang/String;)V

    goto/16 :goto_2

    .line 97
    :cond_6
    iget-object v5, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v5}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v5

    invoke-virtual {v5, v4, v3, v0}, Lcom/instagram/android/d/j/g;->a(Ljava/lang/String;Lcom/fasterxml/jackson/a/l;Lcom/instagram/android/d/j/r;)Z

    move-result v5

    if-nez v5, :cond_0

    .line 99
    if-eqz v4, :cond_0

    .line 103
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->nextToken()Lcom/fasterxml/jackson/a/r;

    move-result-object v5

    .line 105
    sget-object v6, Lcom/fasterxml/jackson/a/r;->d:Lcom/fasterxml/jackson/a/r;

    if-eq v5, v6, :cond_7

    sget-object v6, Lcom/fasterxml/jackson/a/r;->b:Lcom/fasterxml/jackson/a/r;

    if-ne v5, v6, :cond_8

    .line 106
    :cond_7
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->skipChildren()Lcom/fasterxml/jackson/a/l;

    goto/16 :goto_2

    .line 108
    :cond_8
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->getText()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v0, v4, v5}, Lcom/instagram/android/d/j/r;->a(Ljava/lang/String;Ljava/lang/String;)V

    goto/16 :goto_2

    .line 114
    :cond_9
    invoke-virtual {v3}, Lcom/fasterxml/jackson/a/l;->close()V

    .line 115
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V

    .line 119
    iget-object v2, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v2}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v2

    invoke-virtual {v2, v0}, Lcom/instagram/android/d/j/g;->a(Lcom/instagram/android/d/j/r;)V
    :try_end_5
    .catch Ljava/lang/Exception; {:try_start_5 .. :try_end_5} :catch_0

    goto/16 :goto_3

    .line 135
    :cond_a
    :try_start_6
    iget-object v1, p0, Lcom/instagram/android/d/j/q;->n:Lcom/instagram/android/d/j/p;

    invoke-static {v1}, Lcom/instagram/android/d/j/p;->a(Lcom/instagram/android/d/j/p;)Lcom/instagram/android/d/j/g;

    move-result-object v1

    invoke-virtual {v1, v0}, Lcom/instagram/android/d/j/g;->b(Lcom/instagram/android/d/j/r;)V
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_2

    goto/16 :goto_4

    :cond_b
    move-object v2, v3

    goto/16 :goto_1
.end method
